import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'


//在main.js中引入ElementUI
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI)

//引入MyHeader并设置为全局组件
import MyHeader from './components/MyHeader'
Vue.component("my-header",MyHeader)
//引入MyFooter并设置为全局组件
import MyFooter from './components/MyFooter'
Vue.component("my-footer",MyFooter)
//配置RightNav为全局组件
import RightNav from './components/RightNav'
Vue.component("right-nav",RightNav)


//配置axios
import axios from "axios"
axios.defaults.baseURL = "http://localhost:5556"
Vue.prototype.axios = axios




Vue.config.productionTip = false;



//设置每次跳转页面都是默认在顶部
router.afterEach((to, from, next) => {
  window.scrollTo(0, 0);
});


new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
